package com.example.androidcomplete0102.ch15;

import com.example.androidcomplete0102.R;

import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;

public class DisplayMetricsTest extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch15_displaymetricstest);
		
		DisplayMetrics dm = getResources().getDisplayMetrics();
		String str = "widthPixels="+dm.widthPixels+
				"\nheightPixels="+dm.heightPixels+
				"\ndensityDpi="+dm.densityDpi+
				"\ndensity="+dm.density+
				"\nscaledDensity="+dm.scaledDensity+
				"\nxdpi="+dm.xdpi+
				"\nydpi="+dm.ydpi;
		TextView info = (TextView)findViewById(R.id.result);
		info.setText(str);
	}
	
}
